﻿using Microsoft.EntityFrameworkCore;
using studentSubsidy.Entity.Message;
using studentSubsidy.Models;

namespace studentSubsidy.Utils
{
    /// <summary>
    /// 自定义 数据上下文
    /// </summary>
    public class MyDbContext : DbContext
    {
        public DbSet<Project> Project  { get; set; }
        public DbSet<Picture> Picture { get; set; }
        public DbSet<Apply_File> UploadFiles { get; set; }
        public DbSet<Apply> Applies { get; set; }
        public DbSet<User> User { get; set; }
        
        public DbSet<Refund> Refund { get; set; }
        
        public DbSet<Payment> Payment { get; set; }
        
        public DbSet<Message> Message { get; set; }
        public DbSet<Signed_File> SignedFiles { get; set; }
        
        public DbSet<Refund_Log> RefundLogs { get; set; }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //写入连接字符串
            optionsBuilder.UseSqlServer("Data Source=LEETYPC\\SQLEXPRESS01;Initial Catalog=studentSubsidy;User ID=sa;Pwd=123456;Encrypt=True;TrustServerCertificate=True;");
        }
    }
}